package java_thinking.unit_21.Exercise;

/**
 * @Desc:
 * @author: cww
 * @DateTime: 2019/7/5 8:50
 */

public class VolatileTest {
    private static volatile int access = 0;

    public static void main(String[] args) throws InterruptedException {
        new Thread(new Runnable() {
            @Override
            public void run() {
                while (access == 0) {}
            }
        }).start();
        Thread.sleep(100);
        access = 1;
    }
}

